package simple.utils.data.serializers;

import simple.utils.data.Bytes;

import java.io.IOException;

/**
 * Created by rehak on 4/25/14.
 */
public class IntegerSerializer implements Serializer<Integer> {

    @Override
    public byte[] toBytes(Integer s) throws IOException {
        return Bytes.intToBytes(s);
    }

    @Override
    public Integer fromBytes(byte[] data) throws IOException {
        return Bytes.bytesToInt(data);
    }
}
